import redis
import os


_setting_name = os.environ['DJANGO_SETTINGS_MODULE'].split('.')[-1]
if _setting_name in ['localhost']: # 本机环境
	POOL1 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=1, password='123456', max_connections=1000)
	POOL2 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=2, password='123456', max_connections=1000)
	POOL3 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=3, password='123456', max_connections=1000)
elif _setting_name == "ecs": # ecs
	POOL1 = redis.ConnectionPool(host="127.0.0.1", port=6379, db=1, password="123456", max_connections=1000)
	POOL2 = redis.ConnectionPool(host="127.0.0.1", port=6379, db=2, password="123456", max_connections=1000)
	POOL3 = redis.ConnectionPool(host="127.0.0.1", port=6379, db=3, password="123456", max_connections=1000)
else:
	POOL1 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=1, password='123456', max_connections=1000)
	POOL2 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=2, password='123456', max_connections=1000)
	POOL3 = redis.ConnectionPool(host='127.0.0.1', port=6379, db=3, password='123456', max_connections=1000)